<?php

use yii\helpers\Html;
use yii\widgets\LinkPager;
use yii\grid\GridView;

/**
 * @var yii\web\View $this
 * @var amnah\yii2\user\Module $module
 * @var array $actions
 */
global $regionTypes2;
global $prodAttrCodes;
$regionTypes2 = $regionTypes;
$module = $this->context->module;

$this->title = Yii::t('user', 'Yii 2 User');
?>


<?php

$i = 0;
$row = [];
/*
$row[$i]['md']     = 3;
$row[$i]['bg']     = 'aqua';
$row[$i]['num']    = $dataProvider->getTotalCount();
$row[$i]['text']   = '有效客源';
$row[$i]['ion']    = 'fa-sitemap';
$row[$i]['unit']   = '个';
$i++;

$row[$i]['md']     = 3;
$row[$i]['bg']     = 'aqua';
$row[$i]['num']    = $hisTotalOrder ;
$row[$i]['text']   = '历史累计客源总数';
$row[$i]['ion']    = 'fa-sitemap';
$row[$i]['unit']   = '个';
$i++;

$row[$i]['md']     = 3;
$row[$i]['bg']     = 'green';
$row[$i]['num']    = $regionCnt ;
$row[$i]['text']   = '参与处理人员';
$row[$i]['ion']    = 'fa-home';
$row[$i]['unit']   = '名';
$i++;

$row[$i]['md']     = 3;
$row[$i]['bg']     = 'red';
$row[$i]['num']    = $regionTodayCnt;
$row[$i]['text']   = '本日新增';
$row[$i]['ion']    = 'fa-hourglass-end';
$row[$i]['unit']   = '个';
$i++;
*/

$row[$i]['md']     = 2;
$row[$i]['bg']     = 'aqua';
$row[$i]['num']    = $orderCounts['monthOrderCount'] ;
$row[$i]['text']   = '本月新增订单数';
$row[$i]['ion']    = '';
$row[$i]['unit']   = '个';

$i++;

$row[$i]['md']     = 2;
$row[$i]['bg']     = 'aqua';
$row[$i]['num']    = $orderCounts['liveMonthOrderCount'] ;
$row[$i]['text']   = '本月跟进中';
$row[$i]['ion']    = '';
$row[$i]['unit']   = '个';
if ($authority)
{
    $time=date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m"),1,date("Y")));
    if ($model_mng->grade==1)
    {
        $row[$i]['a']   = 'followsupermanger?object_type_id=1&state=30001&time='.$time;

    }
    elseif($model_mng->grade==2){
        $row[$i]['a']   = 'followmanger?object_type_id=1&state=30001&time='.$time;
    }
}else{
    $row[$i]['a']   = 'follow?object_type_id=1&state=30001&time='.$time;
}
$i++;

$row[$i]['md']     = 2;
$row[$i]['bg']     = 'aqua';
$row[$i]['num']    = $orderCounts['weekOrderCount']  ;
$row[$i]['text']   = '本周新增订单数';
$row[$i]['ion']    = '';
$row[$i]['unit']   = '个';
if ($authority) {
    $time = date("Y-m-d H:i:s", mktime(0, 0, 0, date("m"), date("d") - date("w") , date("Y")));
    if ($model_mng->grade==1)
    {
        $row[$i]['a'] = 'followsupermanger?object_type_id=1&ing=ing&time=' . $time;

    }
    elseif($model_mng->grade==2){
        $row[$i]['a']   = 'followmanger?object_type_id=1&ing=ing&time=' . $time;
    }
}else{
    $row[$i]['a']   = 'follow?object_type_id=1&ing=ing&time=' . $time;
}

$i++;

$row[$i]['md']     = 2;
$row[$i]['bg']     = 'aqua';
$row[$i]['num']    = $orderCounts['liveWeekOrderCount'] ;
$row[$i]['text']   = '本周跟进中';
$row[$i]['ion']    = '';
$row[$i]['unit']   = '个';
if ($authority)
{
    $time=date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m"),date("d")-date("w"),date("Y")));
    if ($model_mng->grade==1)
    {
        $row[$i]['a']   = 'followsupermanger?object_type_id=1&state=30001&time='.$time;

    }
    elseif($model_mng->grade==2){
        $row[$i]['a']   = 'followmanger?object_type_id=1&state=30001&time='.$time;
    }
}else{
    $row[$i]['a']   = 'follow?object_type_id=1&state=30001&time='.$time;
}
$i++;

$row[$i]['md']     = 1;
$row[$i]['bg']     = 'green';
$row[$i]['num']    = $orderCounts['dayOrderCount']  ;
$row[$i]['text']   = '本日订单';
$row[$i]['ion']    = '';
$row[$i]['unit']   = '个';
$i++;

$row[$i]['md']     = 1;
$row[$i]['bg']     = 'aqua';
$row[$i]['num']    = $orderCounts['dayOrderCounts'] ;
$row[$i]['text']   = '本日跟进';
$row[$i]['ion']    = '';
$row[$i]['unit']   = '个';
if ($authority)
{
    $time=date("Ymd",strtotime("now"));
    if ($model_mng->grade==1)
    {
        $row[$i]['a']   = 'followsupermanger?object_type_id=1&state=30001&time='.$time;

    }
    elseif($model_mng->grade==2){
        $row[$i]['a']   = 'followmanger?object_type_id=1&state=30001&time='.$time;
    }
}else{
    $row[$i]['a']   = 'follow?object_type_id=1&state=30001&time='.$time;
}
$i++;

$row[$i]['md']     = 2;
$row[$i]['bg']     = 'red';
$row[$i]['num']    = $orderCounts['outOrderCount'];
$row[$i]['text']   = '3日未反馈';
$row[$i]['ion']    = '';
$row[$i]['unit']   = '个';
if ($authority)
{
    
    if ($model_mng->grade==1)
    {
        $row[$i]['a']   = 'followsupermanger?object_type_id=1&state=30001&out_time=3';

    }
    elseif($model_mng->grade==2){
        $row[$i]['a']   = 'followmanger?object_type_id=1&state=30001&out_time=3';
    }
}else{
    $row[$i]['a']   = 'follow?object_type_id=1&state=30001&out_time=3';
}


echo app\common\TBAdminLte::widget('col', $row);

?>







